//
//  TwoViewController.m
//  CJControllers
//
//  Created by hs on 2017/7/3.
//  Copyright © 2017年 jiachen. All rights reserved.
//

#import "TwoViewController.h"
#import "TwoTableViewCell.h"
#import "OtherTableViewCell.h"

@interface TwoViewController ()<UITableViewDelegate,UITableViewDataSource>


@end

static NSString *cellIndexone = @"TwoTableViewCell";
static NSString *cellIndextwo = @"OtherTableViewCell";

@implementation TwoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
 //   self.automaticallyAdjustsScrollViewInsets = NO;
    // Do any additional setup after loading the view.
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    
    return 1000;
    
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    if (indexPath.row % 3) {
        return 120.f;
    }else{
        return 100.f;
    }
    
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    
    return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    
    if (indexPath.row % 3) {
         TwoTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIndexone];
        return cell;
    }else{
        OtherTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIndextwo];
        cell.img = nil;
        return cell;
    }
    
//    if (!cell) {
//         cell = [[[NSBundle mainBundle]loadNibNamed:@"TwoTableViewCell" owner:nil options:nil]firstObject];
////        [tableView registerNib:[UINib nibWithNibName:cellIndex bundle:[NSBundle mainBundle]] forCellReuseIdentifier:cellIndex];
////        cell = [tableView dequeueReusableCellWithIdentifier:cellIndex];
//    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
